const BASE_URL = 'https://www.hngsxy.com/';
//const BASE_URL = 'https://fc-mp-7c5f2fa7-1d2c-41f1-b3dd-1f45e490fd36.next.bspapp.com/http/router/client';
export const myRequestUp = (options) => {
	// const header_tmp = {
	// 	"Authorization": "Bearer"+" "+uni.getStorageSync("Access_token") || ''
	// };
	return new Promise((resolve,reject)=>{
		//console.log(BASE_URL) JSON.stringify(
		uni.request({
			url: BASE_URL+options.url,
			method:options.method || 'GET',
			data:options.data || {},
			dataType:'json',
			// header:{
			// 	"Content-type": "application/json;charset=UTF-8",
			// 	"Content-type": "application/x-www-form-urlencoded;charset=UTF-8"
			// },
			success: (res) => {
				if(res.statusCode !== 200 && res.statusCode !== 201) {
					return uni.showToast({
						title:"请求失败"
					})
				};
				resolve(res)
			},
			fail: (err)=> {
				return uni.showToast({
					title:"请求接口失败"
				})
				reject(err)
			},
		})
	})
}